<ul class="toc_root_list"><li data-link="index"><span>Slang User's Guide</span>
<ul class="toc_list">
<li data-link="introduction"><span>Introduction</span>
<ul class="toc_list">
<li data-link="introduction#why-use-slang"><span>Why use Slang?</span></li>
<li data-link="introduction#who-is-slang-for"><span>Who is Slang for?</span></li>
<li data-link="introduction#who-is-this-guide-for"><span>Who is this guide for?</span></li>
<li data-link="introduction#goals-and-non-goals"><span>Goals and Non-Goals</span></li>
</ul>
</li>
<li data-link="get-started"><span>Getting Started with Slang</span>
<ul class="toc_list">
<li data-link="get-started#installation"><span>Installation</span></li>
<li data-link="get-started#your-first-slang-shader"><span>Your first Slang shader</span></li>
<li data-link="get-started#the-full-example"><span>The full example</span></li>
</ul>
</li>
<li data-link="conventional-features"><span>Conventional Language Features</span>
<ul class="toc_list">
<li data-link="conventional-features#types"><span>Types</span></li>
<li data-link="conventional-features#expressions"><span>Expressions</span></li>
<li data-link="conventional-features#statements"><span>Statements</span></li>
<li data-link="conventional-features#functions"><span>Functions</span></li>
<li data-link="conventional-features#preprocessor"><span>Preprocessor</span></li>
<li data-link="conventional-features#attributes"><span>Attributes</span></li>
<li data-link="conventional-features#global-variables-and-shader-parameters"><span>Global Variables and Shader Parameters</span></li>
<li data-link="conventional-features#shader-entry-points"><span>Shader Entry Points</span></li>
<li data-link="conventional-features#mixed-shader-entry-points"><span>Mixed Shader Entry Points</span></li>
<li data-link="conventional-features#auto-generated-constructors"><span>Auto-Generated Constructors</span></li>
<li data-link="conventional-features#initializer-lists"><span>Initializer Lists</span></li>
</ul>
</li>
<li data-link="convenience-features"><span>Basic Convenience Features</span>
<ul class="toc_list">
<li data-link="convenience-features#type-inference-in-variable-definitions"><span>Type Inference in Variable Definitions</span></li>
<li data-link="convenience-features#immutable-values"><span>Immutable Values</span></li>
<li data-link="convenience-features#namespaces"><span>Namespaces</span></li>
<li data-link="convenience-features#member-functions"><span>Member functions</span></li>
<li data-link="convenience-features#properties"><span>Properties</span></li>
<li data-link="convenience-features#initializers"><span>Initializers</span></li>
<li data-link="convenience-features#operator-overloading"><span>Operator Overloading</span></li>
<li data-link="convenience-features#subscript-operator"><span>Subscript Operator</span></li>
<li data-link="convenience-features#tuple-types"><span>Tuple Types</span></li>
<li data-link="convenience-features#optionalt-type"><span>`Optional&lt;T&gt;` type</span></li>
<li data-link="convenience-features#conditionalt-bool-condition-type"><span>`Conditional&lt;T, bool condition&gt;` Type</span></li>
<li data-link="convenience-features#if_let-syntax"><span>`if_let` syntax</span></li>
<li data-link="convenience-features#reinterprett-operation"><span>`reinterpret&lt;T&gt;` operation</span></li>
<li data-link="convenience-features#pointers-limited"><span>Pointers (limited)</span></li>
<li data-link="convenience-features#descriptorhandle-for-bindless-descriptor-access"><span>`DescriptorHandle` for Bindless Descriptor Access</span></li>
<li data-link="convenience-features#extensions"><span>Extensions</span></li>
<li data-link="convenience-features#multi-level-break"><span>Multi-level break</span></li>
<li data-link="convenience-features#force-inlining"><span>Force inlining</span></li>
<li data-link="convenience-features#error-handling"><span>Error handling</span></li>
<li data-link="convenience-features#special-scoping-syntax"><span>Special Scoping Syntax</span></li>
<li data-link="convenience-features#user-defined-attributes-experimental"><span>User Defined Attributes (Experimental)</span></li>
</ul>
</li>
<li data-link="modules"><span>Modules and Access Control</span>
<ul class="toc_list">
<li data-link="modules#defining-a-module"><span>Defining a Module</span></li>
<li data-link="modules#importing-a-module"><span>Importing a Module</span></li>
<li data-link="modules#access-control"><span>Access Control</span></li>
<li data-link="modules#organizing-file-structure-of-modules"><span>Organizing File Structure of Modules</span></li>
<li data-link="modules#legacy-modules"><span>Legacy Modules</span></li>
</ul>
</li>
<li data-link="capabilities"><span>Capabilities</span>
<ul class="toc_list">
<li data-link="capabilities#capability-atoms-and-capability-requirements"><span>Capability Atoms and Capability Requirements</span></li>
<li data-link="capabilities#conflicting-capabilities"><span>Conflicting Capabilities</span></li>
<li data-link="capabilities#capabilities-between-parent-and-members"><span>Capabilities Between Parent and Members</span></li>
<li data-link="capabilities#capabilities-between-subtype-and-supertype"><span>Capabilities Between Subtype and Supertype</span></li>
<li data-link="capabilities#capabilities-between-requirement-and-implementation"><span>Capabilities Between Requirement and Implementation</span></li>
<li data-link="capabilities#capabilities-of-functions"><span>Capabilities of Functions</span></li>
<li data-link="capabilities#capability-aliases"><span>Capability Aliases</span></li>
<li data-link="capabilities#validation-of-capability-requirements"><span>Validation of Capability Requirements</span></li>
</ul>
</li>
<li data-link="interfaces-generics"><span>Interfaces and Generics</span>
<ul class="toc_list">
<li data-link="interfaces-generics#interfaces"><span>Interfaces</span></li>
<li data-link="interfaces-generics#generics"><span>Generics</span></li>
<li data-link="interfaces-generics#supported-constructs-in-interface-definitions"><span>Supported Constructs in Interface Definitions</span></li>
<li data-link="interfaces-generics#associated-types"><span>Associated Types</span></li>
<li data-link="interfaces-generics#generic-value-parameters"><span>Generic Value Parameters</span></li>
<li data-link="interfaces-generics#type-equality-constraints"><span>Type Equality Constraints</span></li>
<li data-link="interfaces-generics#interface-typed-values"><span>Interface-typed Values</span></li>
<li data-link="interfaces-generics#extending-a-type-with-additional-interface-conformances"><span>Extending a Type with Additional Interface Conformances</span></li>
<li data-link="interfaces-generics#is-and-as-operator"><span>`is` and `as` Operator</span></li>
<li data-link="interfaces-generics#generic-interfaces"><span>Generic Interfaces</span></li>
<li data-link="interfaces-generics#generic-extensions"><span>Generic Extensions</span></li>
<li data-link="interfaces-generics#extensions-to-interfaces"><span>Extensions to Interfaces</span></li>
<li data-link="interfaces-generics#variadic-generics"><span>Variadic Generics</span></li>
<li data-link="interfaces-generics#builtin-interfaces"><span>Builtin Interfaces</span></li>
</ul>
</li>
<li data-link="autodiff"><span>Automatic Differentiation</span>
<ul class="toc_list">
<li data-link="autodiff#auto-diff-operations-fwd_diff-and-bwd_diff"><span>Auto-diff operations `fwd_diff` and `bwd_diff`</span></li>
<li data-link="autodiff#differentiable-type-system"><span>Differentiable Type System</span></li>
<li data-link="autodiff#user-defined-derivative-functions"><span>User-Defined Derivative Functions</span></li>
<li data-link="autodiff#using-auto-diff-with-generics"><span>Using Auto-diff with Generics</span></li>
<li data-link="autodiff#using-auto-diff-with-interface-requirements-and-interface-types"><span>Using Auto-diff with Interface Requirements and Interface Types</span></li>
<li data-link="autodiff#primal-substitute-functions"><span>Primal Substitute Functions</span></li>
<li data-link="autodiff#working-with-mixed-differentiable-and-non-differentiable-code"><span>Working with Mixed Differentiable and Non-Differentiable Code</span></li>
<li data-link="autodiff#higher-order-differentiation"><span>Higher-Order Differentiation</span></li>
<li data-link="autodiff#restrictions-and-known-issues"><span>Restrictions and Known Issues</span></li>
<li data-link="autodiff#reference"><span>Reference</span></li>
</ul>
</li>
<li data-link="compiling"><span>Compiling Code with Slang</span>
<ul class="toc_list">
<li data-link="compiling#concepts"><span>Concepts</span></li>
<li data-link="compiling#command-line-compilation-with-slangc"><span>Command-Line Compilation with `slangc`</span></li>
<li data-link="compiling#using-the-compilation-api"><span>Using the Compilation API</span></li>
<li data-link="compiling#multithreading"><span>Multithreading</span></li>
<li data-link="compiling#compiler-options"><span>Compiler Options</span></li>
<li data-link="compiling#debugging"><span>Debugging</span></li>
</ul>
</li>
<li data-link="reflection"><span>Using the Reflection API</span>
<ul class="toc_list">
<li data-link="reflection#compiling-a-program"><span>Compiling a Program</span></li>
<li data-link="reflection#types-and-variables"><span>Types and Variables</span></li>
<li data-link="reflection#layout-for-types-and-variables"><span>Layout for Types and Variables</span></li>
<li data-link="reflection#programs-and-scopes"><span>Programs and Scopes</span></li>
<li data-link="reflection#calculating-cumulative-offsets"><span>Calculating Cumulative Offsets</span></li>
<li data-link="reflection#determining-whether-parameters-are-used"><span>Determining Whether Parameters Are Used</span></li>
<li data-link="reflection#conclusion"><span>Conclusion</span></li>
</ul>
</li>
<li data-link="targets"><span>Supported Compilation Targets</span>
<ul class="toc_list">
<li data-link="targets#background-and-terminology"><span>Background and Terminology</span></li>
<li data-link="targets#direct3d-11"><span>Direct3D 11</span></li>
<li data-link="targets#direct3d-12"><span>Direct3D 12</span></li>
<li data-link="targets#vulkan"><span>Vulkan</span></li>
<li data-link="targets#opengl"><span>OpenGL</span></li>
<li data-link="targets#metal"><span>Metal</span></li>
<li data-link="targets#cuda-and-optix"><span>CUDA and OptiX</span></li>
<li data-link="targets#cpu-compute"><span>CPU Compute</span></li>
<li data-link="targets#webgpu"><span>WebGPU</span></li>
<li data-link="targets#summary"><span>Summary</span></li>
</ul>
</li>
<li data-link="link-time-specialization"><span>Link-time Specialization and Module Precompilation</span>
<ul class="toc_list">
<li data-link="link-time-specialization#link-time-constants"><span>Link-time Constants</span></li>
<li data-link="link-time-specialization#link-time-types"><span>Link-time Types</span></li>
<li data-link="link-time-specialization#providing-default-settings"><span>Providing Default Settings</span></li>
<li data-link="link-time-specialization#using-precompiling-modules-with-the-api"><span>Using Precompiling Modules with the API</span></li>
<li data-link="link-time-specialization#additional-remarks"><span>Additional Remarks</span></li>
</ul>
</li>
<li data-link="11-language-version"><span>language slang 2026</span>
<ul class="toc_list">
<li data-link="11-language-version#the-legacy-slang-language"><span>The Legacy Slang Language</span></li>
<li data-link="11-language-version#slang-2025"><span>Slang 2025</span></li>
<li data-link="11-language-version#slang-2026"><span>Slang 2026</span></li>
</ul>
</li>
<li data-link="a1-special-topics"><span>Special Topics</span>
<ul class="toc_list">
<li data-link="a1-01-matrix-layout"><span>Handling Matrix Layout Differences on Different Platforms</span>
<ul class="toc_list">
<li data-link="a1-01-matrix-layout#two-conventions-of-matrix-transform-math"><span>Two conventions of matrix transform math</span></li>
<li data-link="a1-01-matrix-layout#discussion"><span>Discussion</span></li>
<li data-link="a1-01-matrix-layout#matrix-layout"><span>Matrix Layout</span></li>
<li data-link="a1-01-matrix-layout#overriding-default-matrix-layout"><span>Overriding default matrix layout</span></li>
</ul>
</li>
<li data-link="a1-03-obfuscation"><span>Obfuscation</span>
<ul class="toc_list">
<li data-link="a1-03-obfuscation#obfuscation-in-slang"><span>Obfuscation in Slang</span></li>
<li data-link="a1-03-obfuscation#using-an-obfuscated-module"><span>Using An Obfuscated Module</span></li>
<li data-link="a1-03-obfuscation#accessing-source-maps"><span>Accessing Source Maps</span></li>
<li data-link="a1-03-obfuscation#accessing-source-maps-without-files"><span>Accessing Source Maps without Files</span></li>
<li data-link="a1-03-obfuscation#emit-source-maps"><span>Emit Source Maps</span></li>
<li data-link="a1-03-obfuscation#issuesfuture-work"><span>Issues/Future Work</span></li>
</ul>
</li>
<li data-link="a1-04-interop"><span>Interoperation with Target-Specific Code</span>
<ul class="toc_list">
<li data-link="a1-04-interop#defining-intrinsic-functions-for-textual-targets"><span>Defining Intrinsic Functions for Textual Targets</span></li>
<li data-link="a1-04-interop#defining-intrinsic-types"><span>Defining Intrinsic Types</span></li>
<li data-link="a1-04-interop#injecting-preludes"><span>Injecting Preludes</span></li>
<li data-link="a1-04-interop#managing-cross-platform-code"><span>Managing Cross-Platform Code</span></li>
<li data-link="a1-04-interop#inline-spirv-assembly"><span>Inline SPIRV Assembly</span></li>
</ul>
</li>
<li data-link="a1-05-uniformity"><span>Uniformity Analysis</span>
<ul class="toc_list">
<li data-link="a1-05-uniformity#treat-values-as-uniform"><span>Treat Values as Uniform</span></li>
<li data-link="a1-05-uniformity#treat-function-return-values-as-non-uniform"><span>Treat Function Return Values as Non-uniform</span></li>
</ul>
</li>
</ul>
</li>
<li data-link="a2-target-specific-features"><span>Target-Specific Features</span>
<ul class="toc_list">
<li data-link="spirv-target-specific"><span>SPIR-V-Specific Functionalities</span>
<ul class="toc_list">
<li data-link="spirv-target-specific#experimental-support-for-the-older-versions-of-spir-v"><span>Experimental support for the older versions of SPIR-V</span></li>
<li data-link="spirv-target-specific#memory-model"><span>Memory model</span></li>
<li data-link="spirv-target-specific#combined-texture-sampler"><span>Combined texture sampler</span></li>
<li data-link="spirv-target-specific#system-value-semantics"><span>System-Value semantics</span></li>
<li data-link="spirv-target-specific#using-sv_instanceid-and-sv_vertexid-with-spir-v-target"><span>Using SV_InstanceID and SV_VertexID with SPIR-V target</span></li>
<li data-link="spirv-target-specific#behavior-of-discard-after-spir-v-16"><span>Behavior of `discard` after SPIR-V 1.6</span></li>
<li data-link="spirv-target-specific#supported-hlsl-features-when-targeting-spir-v"><span>Supported HLSL features when targeting SPIR-V</span></li>
<li data-link="spirv-target-specific#unsupported-glsl-keywords-when-targeting-spir-v"><span>Unsupported GLSL keywords when targeting SPIR-V</span></li>
<li data-link="spirv-target-specific#supported-atomic-types-for-each-target"><span>Supported atomic types for each target</span></li>
<li data-link="spirv-target-specific#constantbuffer-structuredbuffer-and-byteaddressbuffer"><span>ConstantBuffer, StructuredBuffer and ByteAddressBuffer</span></li>
<li data-link="spirv-target-specific#parameterblock-for-spir-v-target"><span>ParameterBlock for SPIR-V target</span></li>
<li data-link="spirv-target-specific#push-constants"><span>Push Constants</span></li>
<li data-link="spirv-target-specific#specialization-constants"><span>Specialization Constants</span></li>
<li data-link="spirv-target-specific#spir-v-specific-attributes"><span>SPIR-V specific Attributes </span></li>
<li data-link="spirv-target-specific#multiple-entry-points-support"><span>Multiple entry points support</span></li>
<li data-link="spirv-target-specific#global-memory-pointers"><span>Global memory pointers</span></li>
<li data-link="spirv-target-specific#matrix-type-translation"><span>Matrix type translation</span></li>
<li data-link="spirv-target-specific#legalization"><span>Legalization</span></li>
<li data-link="spirv-target-specific#tessellation"><span>Tessellation</span></li>
<li data-link="spirv-target-specific#spir-v-specific-compiler-options"><span>SPIR-V specific Compiler options</span></li>
</ul>
</li>
<li data-link="metal-target-specific"><span>Metal-Specific Functionalities</span>
<ul class="toc_list">
<li data-link="metal-target-specific#entry-point-parameter-handling"><span>Entry Point Parameter Handling</span></li>
<li data-link="metal-target-specific#system-value-semantics"><span>System-Value semantics</span></li>
<li data-link="metal-target-specific#interpolation-modifiers"><span>Interpolation Modifiers</span></li>
<li data-link="metal-target-specific#resource-types"><span>Resource Types</span></li>
<li data-link="metal-target-specific#array-types"><span>Array Types</span></li>
<li data-link="metal-target-specific#matrix-layout"><span>Matrix Layout</span></li>
<li data-link="metal-target-specific#mesh-shader-support"><span>Mesh Shader Support</span></li>
<li data-link="metal-target-specific#header-inclusions-and-namespace"><span>Header Inclusions and Namespace</span></li>
<li data-link="metal-target-specific#parameter-blocks-and-argument-buffers"><span>Parameter blocks and Argument Buffers</span></li>
<li data-link="metal-target-specific#struct-parameter-flattening"><span>Struct Parameter Flattening</span></li>
<li data-link="metal-target-specific#return-value-handling"><span>Return Value Handling</span></li>
<li data-link="metal-target-specific#value-type-conversion"><span>Value Type Conversion</span></li>
<li data-link="metal-target-specific#conservative-rasterization"><span>Conservative Rasterization</span></li>
<li data-link="metal-target-specific#address-space-assignment"><span>Address Space Assignment</span></li>
<li data-link="metal-target-specific#explicit-parameter-binding"><span>Explicit Parameter Binding</span></li>
<li data-link="metal-target-specific#specialization-constants"><span>Specialization Constants</span></li>
</ul>
</li>
<li data-link="wgsl-target-specific"><span>WGSL-Specific Functionalities</span>
<ul class="toc_list">
<li data-link="wgsl-target-specific#system-value-semantics"><span>System-Value semantics</span></li>
<li data-link="wgsl-target-specific#supported-hlsl-features-when-targeting-wgsl"><span>Supported HLSL features when targeting WGSL</span></li>
<li data-link="wgsl-target-specific#supported-atomic-types"><span>Supported atomic types</span></li>
<li data-link="wgsl-target-specific#constantbuffer-rwrasterizerorderedstructuredbuffer-rwrasterizerorderedbyteaddressbuffer"><span>ConstantBuffer, (RW/RasterizerOrdered)StructuredBuffer, (RW/RasterizerOrdered)ByteAddressBuffer</span></li>
<li data-link="wgsl-target-specific#interlocked-operations"><span>Interlocked operations</span></li>
<li data-link="wgsl-target-specific#entry-point-parameter-handling"><span>Entry Point Parameter Handling</span></li>
<li data-link="wgsl-target-specific#parameter-blocks"><span>Parameter blocks</span></li>
<li data-link="wgsl-target-specific#write-only-textures"><span>Write-only Textures</span></li>
<li data-link="wgsl-target-specific#pointers"><span>Pointers</span></li>
<li data-link="wgsl-target-specific#address-space-assignment"><span>Address Space Assignment</span></li>
<li data-link="wgsl-target-specific#matrix-type-translation"><span>Matrix type translation</span></li>
<li data-link="wgsl-target-specific#explicit-parameter-binding"><span>Explicit Parameter Binding</span></li>
<li data-link="wgsl-target-specific#specialization-constants"><span>Specialization Constants</span></li>
</ul>
</li>
<li data-link="glsl-target-specific"><span>GLSL-Specific Functionalities</span>
<ul class="toc_list">
<li data-link="glsl-target-specific#combined-texture-sampler"><span>Combined Texture Sampler</span></li>
<li data-link="glsl-target-specific#system-value-semantics"><span>System-Value Semantics</span></li>
<li data-link="glsl-target-specific#discard-statement"><span>`discard` Statement</span></li>
<li data-link="glsl-target-specific#hlsl-features-supported-in-glsl"><span>HLSL Features Supported in GLSL</span></li>
<li data-link="glsl-target-specific#atomic-types"><span>Atomic Types</span></li>
<li data-link="glsl-target-specific#buffer-types"><span>Buffer Types</span></li>
<li data-link="glsl-target-specific#matrix-layout"><span>Matrix Layout</span></li>
<li data-link="glsl-target-specific#entry-points"><span>Entry Points</span></li>
<li data-link="glsl-target-specific#specialization-constants"><span>Specialization Constants</span></li>
<li data-link="glsl-target-specific#attributes-and-layout-qualifiers"><span>Attributes and Layout Qualifiers</span></li>
<li data-link="glsl-target-specific#glsl-specific-compiler-options"><span>GLSL-Specific Compiler Options</span></li>
</ul>
</li>
</ul>
</li>
<li data-link="reference"><span>Reference</span>
<ul class="toc_list">
<li data-link="a3-01-reference-capability-profiles"><span>Capability Profiles</span>
</li>
<li data-link="a3-02-reference-capability-atoms"><span>Capability Atoms</span>
<ul class="toc_list">
<li data-link="a3-02-reference-capability-atoms#targets"><span>Targets</span></li>
<li data-link="a3-02-reference-capability-atoms#stages"><span>Stages</span></li>
<li data-link="a3-02-reference-capability-atoms#versions"><span>Versions</span></li>
<li data-link="a3-02-reference-capability-atoms#extensions"><span>Extensions</span></li>
<li data-link="a3-02-reference-capability-atoms#compound-capabilities"><span>Compound Capabilities</span></li>
<li data-link="a3-02-reference-capability-atoms#other"><span>Other</span></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>